﻿using System.Data.Entity.ModelConfiguration;
using Budjelar.Model.Entities;

namespace Budjelar.Repository.EF.Configuration
{
    public class RacunConfiguration : EntityTypeConfiguration<Racun>
    {
        public RacunConfiguration()
        {
            ToTable("Racuni");
            HasRequired(x => x.Prodavnica).WithMany().HasForeignKey(x => x.IdProdavnice);
            HasMany(x => x.Stavke).WithRequired(x => x.Racun).HasForeignKey(x => x.IdRacuna);
        }
    }
}